<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/css/main.css}"/>
</head>

<body>
<div>
    <nav class="navbar navbar-light bg-light">
        <a class="navbar-brand" href="/userCon/userFragment">
            个人中心
        </a>
    </nav>
    <div style="height: 50px"></div>
    <div style="color: red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;全部房源</div>
    <div id="all" style="width: 500px;margin: auto">
        <div>
            <th:block th:each="pn:${pageInfo}">
                <div class="jumbotron">
                    <img th:src="${pn.getImg}" style="height:100px;width: 100px">
                    <div style="float: right">
                        <p th:text="'房源标题：'+${pn.getHomeTitle}"/>
                        <p th:text="'房屋类型：'+${pn.getHomeType}"/>
                        <p th:text="'房屋面积：'+${pn.getHomeSize}"/>
                    </div>
                </div>
            </th:block>
        </div>

        <!--分页尾部导航-->
        <nav aria-label="Page navigation example">
            <ul class="pagination">
                <li class="page-item">
                    <th:block th:if="${pageNo>1}">
                        <a class="page-link" th:href="'/mainPage/'+${pageNo-1}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                            <span class="sr-only">Previous</span>
                        </a>
                    </th:block>
                    <th:block th:if="${pageNo==1}">
                        <a class="page-link" href="#" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                            <span class="sr-only">Previous</span>
                        </a>
                    </th:block>
                </li>
                <th:block th:each="pn:${rainbow}">
                    <li class="page-item"><a class="page-link" th:href="'/mainPage/'+${pn}" th:text="${pn}"></a></li>
                </th:block>
                <li class="page-item">
                    <th:block  th:if="${pageNo>=totalPages}">
                        <a class="page-link" href="#" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                            <span class="sr-only">Next</span>
                        </a>
                    </th:block>
                    <th:block th:if="${pageNo<totalPages}">
                        <a class="page-link" th:href="'/mainPage/'+${pageNo+1}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                            <span class="sr-only">Next</span>
                        </a>
                    </th:block>
                </li>
            </ul>
        </nav>
    </div>
    <div style="height: 20px"></div>
    <div>

    </div>
</div>


<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
</body>

</html>